<?php
$CURRENT_URL = (!empty($_SERVER['HTTPS'])) ? "https://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] : "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
	if (!isset($_SESSION['username'])) {
		?>
	<style>
        .social_sidebar{
            text-align:center;
        }
        .social_sidebar{
            float:left;
        }
        .social_sidebar img{
            width:25px;
            height:25px;
        }
		#acc_connect{
		    background-color: #2F96B4;
			background-image-moz -linear-gradient(center top , #5BC0DE, #2F96B4);
			color: #FFFFFF;
			text-decoration:none;
			font:bold;
		}
    </style>
    <?php
}
?>
<!--Facebook Like Page-->

<div class="box pav-custom  ">
    <div class="box-heading heading-box"><h2><?php echo $lang['FACEBOOK_PAGE']; ?></h2></div>
    <div class="box-content" style="padding:10px">
			<?php
				include(S_ROOT.'/templates/facebook-page.php');
			?>
    </div>
</div>
<!--end Facebook Like Page-->

<!--top 5 province-->

<div class="box pav-custom  ">
    <div class="box-heading heading-box"><h2><?php echo $lang['TOP_5_PROVINCE']; ?></h2></div>
    <div class="box-content" style="padding:10px">
        <ul>
			<?php
				include(S_ROOT.'/templates/top5province.php');
			?>
        </ul>
    </div>
</div>
<!--end top 5 province-->

<!--welcome message-->
<div class="box pav-custom  ">
    <div class="box-heading heading-box"><h2><?php echo $lang['WELCOME_MESSAGE']; ?></h2></div>
    <div class="box-content" style="padding:10px">
		<?php
			$product_numbers = mysql_query("SELECT * FROM ".Tblproduct::tblproduct." ");
		?>
        The most advanced classifieds site in Cambodia which uses the latest web technology. Posting an Ad on
        PsarInternet.com is FREE and there is NO COMMISSION.
        <BR/>
        PsarInternet.com is based on a very Simple idea: the Good Deal is in fact next to you! To Buy or to Sell,
        please  first choose your interested area and Find the Good Deal among our <?php echo '<a href="product/?searchby=1&"><strong style="color:#F89406;">'.mysql_num_rows($product_numbers).'</strong></a>'; ?> ads.
    </div>
</div>
<!--end welcome message-->
<!--youtube-->
<div class="box pav-custom">
    <div class="box-heading heading-box"><h2><?php echo $lang['YOUTUBE_PLAYER']; ?></h2></div>
    <div class="box-content">
        <div class="youtube-player" style="padding:10px;">
            <?php
            $Publish = 1;
            $sql = "SELECT * FROM " . Tblvdoyoutube::tblvdoyoutube . " WHERE " . Tblvdoyoutube::vdo_status . " =" . $Publish." ORDER BY id DESC LIMIT 1";
            $result = mysql_query($sql);
            $numrows = mysql_num_rows($result);
            $rows = mysql_fetch_assoc($result);
            if ($numrows > 0) {
                ?>
                <iframe width="100%" height="180" src="//www.youtube.com/embed/<?php echo $rows[Tblvdoyoutube::vdo_ytb_id]; ?>?feature=player_detailpage" frameborder="0" allowfullscreen></iframe>
            <?php } ?>
            <span><a href="<?php echo base_url;?>/more_video_youtub.php">See more videos...</a></span>
        </div>
    </div>
</div>
<!--end youtube-->

<!--horoscop-->
<div class="box pav-custom  ">
    <div class="box-heading heading-box"><h2>​​ <?php echo $lang['HOROSCOPE']; ?></h2></div>
    <div class="box-content" style="padding:10px">
		<?php include(S_ROOT.'/templates/horoscope.php');?>
    </div>
</div>
<!--end horoscop-->

<!--contact-->
	<?php include(S_ROOT.'/templates/home_right_advertise.php');?>
<!--end contact-->
<?php
 $sql = "SELECT * FROM tbl_refcode WHERE ref_type='visitors'";
            $result = mysql_query($sql);
            $numrows = mysql_fetch_assoc($result);
           if($numrows['ref_value']==1){
?>
<!--contact-->
<div class="box pav-custom">
    <div class="box-heading heading-box"><h2><?php echo $lang['VISITOR_COUNTER']; ?></h2></div>
    <div class="box-content">
        <div class="youtube-player" style="padding:10px;">
            <?php require (S_ROOT . '/templates/r_visitor_counter.php'); ?>
        </div>
    </div>
</div>
<!--end contact-->
<?php } ?>